
class Public:

    def __init__(self,driver):
        logger.info("初始化对象")
        self.driver = driver

    def getSize(self):
        x = self.driver.get_window_size()['width']
        y = self.driver.get_window_size()['height']
        logger.info(f"width={x}，heigth={y}")
        x1 = x * 0.75
        x2 = x * 0.25
        y1 = y * 0.75
        y2 = y * 0.25
        return x1, y1, x2, y2

    def swipUp(self):
        logger.info("准备平移坐标")
        x1, y1, x2, y2 = self.getSize()
        self.driver.swipe(x1, y1, x1, y2)


if __name__ == '__main__':
    from common.driver import Driver
    driver = Driver().startUp()
    from log import logger

    logger.info(driver)
    Public(driver).swipUp()